package com.kexinde.wjifen.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.kexinde.wjifen.model.Shopkeeper;

@Component("shopkeeperDao")
public class ShopkeeperDao extends BaseDao<Shopkeeper> {

	@SuppressWarnings("unchecked")
	public Shopkeeper findByName(String name) {
		List<Shopkeeper> shopkeepers = hibernateTemplate
				.find("from Shopkeeper s where s.userName=" + "'"+name+"'");
		if (null == shopkeepers || 0 == shopkeepers.size()) {
			return null;
		}
		return shopkeepers.get(0);
	}
}
